package com.eboss.sbs.activity;

import android.os.Bundle;
import android.view.View;

import com.eboss.sbs.R;
import com.eboss.sbs.activity.base.BaseActivity;
import com.eboss.sbs.http.API;
import com.eboss.sbs.http.HttpCallback;
import com.eboss.sbs.model.DCouponIssueListEntity;
import com.google.gson.reflect.TypeToken;

import java.util.HashMap;
import java.util.Map;

public class DCouponIssueActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		mActivity = this;
		setContentView(R.layout.activity_coupon_issue);
		super.onCreate(savedInstanceState);
		initView();
		getData();
	}
	
	private void initView(){
		setTvText(R.id.tv_title, "优惠券领取核销报表");
		findViewById(R.id.titleback_btn_back).setOnClickListener(this);
		
		
	}
	
	private void getData(){
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("sid", mApp.getLoginEntity().getSid());
		API.http_post(this, API.D_COUPON_ISSUE, params, new HttpCallback<DCouponIssueListEntity>(this) {
			@Override
			public void onSuccess(int statusCode, DCouponIssueListEntity data) {
				if(data!=null){
//					 List<PointEntity> tmp_datas = data.getActivities();
//					 if(tmp_datas!=null&&tmp_datas.size()>0){
//						 datas.addAll(tmp_datas);
//					 }
				}
//				adapter.notifyDataSetChanged();
			}
			@SuppressWarnings({ "unchecked", "rawtypes" })
			@Override
			public TypeToken getTypeToken() {
				return new TypeToken<DCouponIssueListEntity>() {
				};
			}
		});
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.titleback_btn_back:
				finish();
				break;
	
			default:break;
		}
		super.onClick(v);
	}
	
}
